/*
 Navicat Premium Data Transfer

 Source Server         : energy
 Source Server Type    : MySQL
 Source Server Version : 50562
 Source Host           : 103.36.192.219:3308
 Source Schema         : gd-energy

 Target Server Type    : MySQL
 Target Server Version : 50562
 File Encoding         : 65001

 Date: 06/08/2020 22:39:41
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for energy_admin
-- ----------------------------
DROP TABLE IF EXISTS `energy_admin`;
CREATE TABLE `energy_admin` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `company_id` bigint(20) DEFAULT NULL,
  `create_date` datetime NOT NULL,
  `modify_date` datetime NOT NULL,
  `operator_id` bigint(20) DEFAULT NULL,
  `department` varchar(255) DEFAULT NULL,
  `email` varchar(255) NOT NULL,
  `is_enabled` bit(1) NOT NULL DEFAULT b'1',
  `is_locked` bit(1) NOT NULL DEFAULT b'1',
  `locked_date` datetime DEFAULT NULL,
  `login_date` datetime DEFAULT NULL,
  `login_failure_count` int(11) NOT NULL DEFAULT '0',
  `login_ip` varchar(255) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `password` varchar(255) NOT NULL,
  `username` varchar(100) NOT NULL,
  `company` varchar(255) DEFAULT NULL,
  `position` varchar(255) DEFAULT NULL,
  `tel_phone` varchar(255) DEFAULT NULL,
  `is_del` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除 0正常1删除',
  `energy_type` int(11) DEFAULT '1' COMMENT '类型1水表',
  PRIMARY KEY (`id`),
  UNIQUE KEY `username` (`username`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of energy_admin
-- ----------------------------
BEGIN;
INSERT INTO `energy_admin` VALUES (1, NULL, '2018-07-02 10:41:48', '2020-07-19 09:43:15', NULL, NULL, '1256985@qq.com', b'1', b'0', '2020-08-03 17:11:50', '2020-08-06 22:36:08', 1, '127.0.0.1', '超级管理员', '5169400c0a7e4cb221d28cbd964cd3a642874ab5', 'admin', NULL, NULL, '18751570619', b'0', 1);
INSERT INTO `energy_admin` VALUES (4, NULL, '2020-08-06 16:15:19', '2020-08-06 16:31:59', 1, 'string', 'string', b'1', b'0', NULL, NULL, 0, NULL, 'string', '1d54c8e86b06543bd07b3db6c006b7d2f5292f50', 'admin2', NULL, NULL, NULL, b'0', 1);
COMMIT;

-- ----------------------------
-- Table structure for energy_admin_role
-- ----------------------------
DROP TABLE IF EXISTS `energy_admin_role`;
CREATE TABLE `energy_admin_role` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL COMMENT '用户id',
  `role_id` int(11) NOT NULL COMMENT '角色id',
  `energy_type` int(11) DEFAULT '1' COMMENT '类型1，水表',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of energy_admin_role
-- ----------------------------
BEGIN;
INSERT INTO `energy_admin_role` VALUES (1, 1, 2, 1);
INSERT INTO `energy_admin_role` VALUES (10, 4, 1, 1);
INSERT INTO `energy_admin_role` VALUES (11, 4, 2, 1);
COMMIT;

-- ----------------------------
-- Table structure for energy_app_admin_detail
-- ----------------------------
DROP TABLE IF EXISTS `energy_app_admin_detail`;
CREATE TABLE `energy_app_admin_detail` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `admin_id` bigint(20) DEFAULT NULL,
  `company_id` bigint(20) DEFAULT NULL,
  `create_date` datetime NOT NULL,
  `energy_type` int(11) DEFAULT NULL,
  `is_del` bit(1) NOT NULL,
  `modify_date` datetime NOT NULL,
  `operator_id` bigint(20) DEFAULT NULL,
  `file_name` varchar(255) DEFAULT NULL,
  `file_path` longtext,
  `household_id` bigint(20) DEFAULT NULL,
  `nick_name` varchar(255) DEFAULT NULL,
  `balance` decimal(19,2) DEFAULT NULL,
  `over_money` decimal(19,2) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `admin_id` (`admin_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of energy_app_admin_detail
-- ----------------------------
BEGIN;
INSERT INTO `energy_app_admin_detail` VALUES (2, 4, NULL, '2020-08-06 16:31:59', 1, b'0', '2020-08-06 16:31:59', 1, NULL, NULL, NULL, NULL, 2.00, 2.00);
COMMIT;

-- ----------------------------
-- Table structure for energy_area_organization
-- ----------------------------
DROP TABLE IF EXISTS `energy_area_organization`;
CREATE TABLE `energy_area_organization` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `company_id` bigint(20) DEFAULT NULL,
  `create_date` datetime NOT NULL,
  `energy_type` int(11) DEFAULT NULL,
  `is_del` bit(1) NOT NULL,
  `modify_date` datetime NOT NULL,
  `operator_id` bigint(20) DEFAULT NULL,
  `area_contact_mail` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL,
  `area_contact_name` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL,
  `area_contact_phone` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL,
  `area_contact_tel` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL,
  `area_map_latitude` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL,
  `area_map_longitude` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL,
  `area_name` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL,
  `area_parent_id` bigint(20) DEFAULT NULL,
  `area_serialnumber` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL,
  `is_day_settlement` int(11) DEFAULT NULL,
  `is_send_sms` int(11) DEFAULT NULL,
  `settlement_day` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COMMENT='区域';

-- ----------------------------
-- Records of energy_area_organization
-- ----------------------------
BEGIN;
INSERT INTO `energy_area_organization` VALUES (1, NULL, '2020-03-29 14:00:55', 1, b'0', '2020-03-29 14:04:01', 1, NULL, NULL, NULL, NULL, NULL, NULL, '中国', 0, 'AREA20200329140036', 0, 0, '25');
INSERT INTO `energy_area_organization` VALUES (2, NULL, '2020-03-29 14:01:20', 1, b'0', '2020-07-03 09:07:57', 1, NULL, NULL, NULL, NULL, '32.066776944293416', '118.76955164466914', '江苏省', 1, 'AREA20200329140100', 0, 0, '25');
INSERT INTO `energy_area_organization` VALUES (3, NULL, '2020-07-08 14:08:49', 1, b'0', '2020-07-10 06:35:25', 1, NULL, NULL, NULL, NULL, '34.740396071091155', '101.62247338027404', '河南', 0, 'AREA20200708140831', 0, 0, '1');
INSERT INTO `energy_area_organization` VALUES (5, NULL, '2020-07-08 15:12:33', 1, b'0', '2020-07-19 19:23:44', 1, NULL, NULL, NULL, NULL, '31.498809732685714', '120.31858328810601', '无锡市', 2, 'AREA20200708151213', 1, 1, '1');
INSERT INTO `energy_area_organization` VALUES (6, NULL, '2020-07-08 15:15:09', 1, b'0', '2020-07-08 15:15:09', 1, NULL, NULL, NULL, NULL, NULL, NULL, '上海市', 1, 'AREA20200708151459', 1, 1, '5');
INSERT INTO `energy_area_organization` VALUES (7, NULL, '2020-07-08 15:16:29', 1, b'0', '2020-07-08 15:16:29', 1, NULL, NULL, NULL, NULL, NULL, NULL, '河南省', 1, 'AREA20200708151615', 1, 1, '10');
INSERT INTO `energy_area_organization` VALUES (8, NULL, '2020-07-08 15:16:55', 1, b'0', '2020-07-19 19:23:19', 1, NULL, NULL, NULL, NULL, '34.4202016658586', '115.66244933826238', '商丘市', 7, 'AREA20200708151633', 1, 1, '20');
COMMIT;

-- ----------------------------
-- Table structure for energy_log
-- ----------------------------
DROP TABLE IF EXISTS `energy_log`;
CREATE TABLE `energy_log` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `company_id` bigint(20) DEFAULT NULL,
  `create_date` datetime NOT NULL,
  `energy_type` int(11) DEFAULT NULL,
  `is_del` bit(1) NOT NULL,
  `modify_date` datetime NOT NULL,
  `operator_id` bigint(20) DEFAULT NULL,
  `content` longtext,
  `ip` varchar(255) NOT NULL,
  `operation` varchar(255) NOT NULL,
  `operator` varchar(255) DEFAULT NULL,
  `parameter` longtext,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of energy_log
-- ----------------------------
BEGIN;
INSERT INTO `energy_log` VALUES (1, NULL, '2020-08-06 22:19:28', 1, b'0', '2020-08-06 22:19:28', NULL, NULL, '127.0.0.1', '登录', 'admin', '');
INSERT INTO `energy_log` VALUES (2, NULL, '2020-08-06 22:22:42', 1, b'0', '2020-08-06 22:22:42', NULL, NULL, '127.0.0.1', '登录', 'admin', '');
INSERT INTO `energy_log` VALUES (3, NULL, '2020-08-06 22:29:37', 1, b'0', '2020-08-06 22:29:37', NULL, NULL, '127.0.0.1', '登录', 'admin', '');
INSERT INTO `energy_log` VALUES (4, NULL, '2020-08-06 22:30:51', 1, b'0', '2020-08-06 22:30:51', NULL, NULL, '127.0.0.1', '获取当前登录用户的最新信息', 'admin', '');
INSERT INTO `energy_log` VALUES (5, NULL, '2020-08-06 22:31:35', 1, b'0', '2020-08-06 22:31:35', NULL, NULL, '127.0.0.1', '登录', 'admin', '');
INSERT INTO `energy_log` VALUES (6, NULL, '2020-08-06 22:33:52', 1, b'0', '2020-08-06 22:33:52', NULL, NULL, '127.0.0.1', '登录', 'admin', '[{\"code\":\"string\",\"sessionId\":\"string\",\"password\":\"admin\",\"username\":\"admin\"}]');
INSERT INTO `energy_log` VALUES (7, NULL, '2020-08-06 22:36:09', 1, b'0', '2020-08-06 22:36:09', NULL, NULL, '127.0.0.1', '登录', 'admin', '[{\"code\":\"string\",\"sessionId\":\"string\",\"password\":\"admin\",\"username\":\"admin\"}]');
INSERT INTO `energy_log` VALUES (8, NULL, '2020-08-06 22:36:39', 1, b'0', '2020-08-06 22:36:39', NULL, NULL, '127.0.0.1', '后台管理员分页列表', 'admin', '[\"213\",\"123\",10,1,\"id\",\"asc\"]');
COMMIT;

-- ----------------------------
-- Table structure for energy_permission
-- ----------------------------
DROP TABLE IF EXISTS `energy_permission`;
CREATE TABLE `energy_permission` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL COMMENT '权限名称',
  `description` varchar(255) DEFAULT NULL COMMENT '权限描述',
  `perms` varchar(255) DEFAULT NULL COMMENT '权限标识',
  `order_num` int(3) DEFAULT '0' COMMENT '排序',
  `parent_id` int(11) DEFAULT NULL COMMENT '父级权限id',
  `type` int(1) DEFAULT NULL COMMENT '类型   0：目录   1：菜单   2：按钮',
  `create_date` datetime DEFAULT NULL COMMENT '创建时间',
  `modify_date` datetime DEFAULT NULL COMMENT '更新时间',
  `energy_type` int(11) DEFAULT '1' COMMENT '类型1，水表',
  `is_del` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除  0正常 1.删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of energy_permission
-- ----------------------------
BEGIN;
INSERT INTO `energy_permission` VALUES (1, '角色管理', '角色管理', NULL, 1, 0, 1, NULL, NULL, 1, b'0');
INSERT INTO `energy_permission` VALUES (3, '列表', '列表', 'admin:list', 0, 1, 2, NULL, NULL, 1, b'0');
INSERT INTO `energy_permission` VALUES (4, '添加', '添加', 'admin:add', 1, 1, 2, NULL, NULL, 1, b'0');
INSERT INTO `energy_permission` VALUES (5, '编辑', '编辑', 'admin:update', 2, 1, 2, NULL, NULL, 1, b'0');
INSERT INTO `energy_permission` VALUES (6, '删除', '删除', 'admin:delete', 3, 1, 2, NULL, NULL, 1, b'0');
COMMIT;

-- ----------------------------
-- Table structure for energy_role
-- ----------------------------
DROP TABLE IF EXISTS `energy_role`;
CREATE TABLE `energy_role` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) NOT NULL COMMENT '角色名称',
  `is_system` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否系统内置1是0否',
  `description` varchar(255) DEFAULT NULL COMMENT '角色描述',
  `create_date` datetime DEFAULT NULL COMMENT '创建时间',
  `modify_date` datetime DEFAULT NULL COMMENT '更新时间',
  `energy_type` int(11) DEFAULT '1' COMMENT '类型1，水表',
  `is_del` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除 0正常 1删除',
  `company_id` bigint(20) DEFAULT NULL,
  `operator_id` bigint(20) DEFAULT NULL,
  `area_ids` varchar(255) DEFAULT NULL,
  `area_big_ids` varchar(255) DEFAULT NULL,
  `equipment_ids` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of energy_role
-- ----------------------------
BEGIN;
INSERT INTO `energy_role` VALUES (1, '超级管理员', b'1', '拥有所有权限', NULL, NULL, 1, b'0', NULL, NULL, NULL, NULL, NULL);
INSERT INTO `energy_role` VALUES (2, 'test', b'0', 'test', NULL, NULL, 1, b'0', NULL, NULL, NULL, NULL, NULL);
INSERT INTO `energy_role` VALUES (3, 'string2', b'0', 'string', '2020-08-06 10:51:14', '2020-08-06 11:29:10', 1, b'1', NULL, 1, '1,2', NULL, '2,3');
COMMIT;

-- ----------------------------
-- Table structure for energy_role_permission
-- ----------------------------
DROP TABLE IF EXISTS `energy_role_permission`;
CREATE TABLE `energy_role_permission` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `role_id` int(11) NOT NULL COMMENT '角色id',
  `permission_id` int(11) NOT NULL COMMENT '权限id',
  `energy_type` int(11) DEFAULT '1' COMMENT '类型1，水表',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of energy_role_permission
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for energy_sysconfig_equipmentmodel
-- ----------------------------
DROP TABLE IF EXISTS `energy_sysconfig_equipmentmodel`;
CREATE TABLE `energy_sysconfig_equipmentmodel` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `company_id` bigint(20) DEFAULT NULL,
  `create_date` datetime NOT NULL,
  `energy_type` int(11) DEFAULT NULL,
  `is_del` bit(1) NOT NULL,
  `modify_date` datetime NOT NULL,
  `operator_id` bigint(20) DEFAULT NULL,
  `equ_size` double NOT NULL,
  `equ_weight` double NOT NULL,
  `equipment_type` int(11) DEFAULT NULL,
  `memo` varchar(255) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `serialnumber` varchar(100) NOT NULL,
  `supplier` bigint(20) DEFAULT NULL,
  `api_key` varchar(255) DEFAULT NULL,
  `app_id` varchar(255) DEFAULT NULL,
  `equipmentnbtype` int(11) DEFAULT NULL,
  `secret` varchar(255) DEFAULT NULL,
  `device_type` varchar(255) DEFAULT NULL,
  `manufacturer_id` varchar(255) DEFAULT NULL,
  `manufacturer_name` varchar(255) DEFAULT NULL,
  `model` varchar(255) DEFAULT NULL,
  `protocol_type` varchar(255) DEFAULT NULL,
  `domain_name` varchar(255) DEFAULT NULL,
  `archives_len` int(11) DEFAULT NULL,
  `access_token` varchar(255) DEFAULT NULL,
  `down_linkurl` varchar(255) DEFAULT NULL,
  `equipmentloratype` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `supplier` (`supplier`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of energy_sysconfig_equipmentmodel
-- ----------------------------
BEGIN;
INSERT INTO `energy_sysconfig_equipmentmodel` VALUES (1, NULL, '2020-06-20 12:00:42', 1, b'0', '2020-07-10 20:19:35', 1, 10, 10, 2, NULL, '电信水表NBIOT', 'EQ20200620120011', 4, NULL, NULL, 4, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 7, NULL, NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for energy_sysconfig_supplier
-- ----------------------------
DROP TABLE IF EXISTS `energy_sysconfig_supplier`;
CREATE TABLE `energy_sysconfig_supplier` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `company_id` bigint(20) DEFAULT NULL,
  `create_date` datetime NOT NULL,
  `energy_type` int(11) DEFAULT NULL,
  `is_del` bit(1) NOT NULL,
  `modify_date` datetime NOT NULL,
  `operator_id` bigint(20) DEFAULT NULL,
  `memo` varchar(100) DEFAULT NULL,
  `supplier_address` varchar(100) NOT NULL,
  `supplier_contact` varchar(100) NOT NULL,
  `supplier_email` varchar(255) DEFAULT NULL,
  `supplier_name` varchar(100) NOT NULL,
  `supplier_phone` varchar(255) DEFAULT NULL,
  `supplier_serialnumber` varchar(255) DEFAULT NULL,
  `supplier_tel` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of energy_sysconfig_supplier
-- ----------------------------
BEGIN;
INSERT INTO `energy_sysconfig_supplier` VALUES (3, NULL, '2019-06-12 10:38:37', NULL, b'0', '2020-07-10 20:18:36', 1, NULL, '江苏无锡新吴区', '邹杰夫', 'jeffzou@ucskype.com', '日海智能', NULL, 'GYS20190612103805', NULL);
INSERT INTO `energy_sysconfig_supplier` VALUES (4, NULL, '2020-07-08 14:07:41', NULL, b'0', '2020-07-10 18:12:06', 1, NULL, '上海市长宁区金钟路633号', '马艳霞', 'mayanxia@sunseaaiot.com', '日海物联', '13817820954', 'GYS20200708140712', NULL);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
